motorcycles = ['honda', 'yamaha', 'suzuki']
print(motorcycles)

#在列表中修改元素
motorcycles[0] = "ducati"
print(motorcycles)

#在列表中添加元素
motorcycles.append('honda')
print(motorcycles)

space = []
space.append('honda')
space.append('yamaha')
space.append('suzuki')
print(space)

#在列表中插入元素
space.insert(0, 'ducati')
print(space)

#在列表中删除元素
del space[0]
print(space)

#使用pop()删除元素
poped_space = space.pop()
print(space)
print(poped_space)

#方法pop()可删除列表末尾的元素，并让你能够接着使用它
#你可以使用pop()来删除列表中的任何位置的元素，只需要在括号中指定要删除的元素的索引即可
first_owned = space.pop(0)
print('The first sapce I owned was a ' + first_owned.title() + '.')

#根据值删除元素
print(motorcycles)
motorcycles.remove('ducati')
print(motorcycles)

#使用remove()从列表中删除元素时，也可以接着使用它的值
moto = ['honda', 'yamaha', 'suzuki', 'ducati']
print(moto)
too_expensive = 'ducati'
moto.remove(too_expensive)
print(moto)
print("\nA " + too_expensive.title() + " is too expensive for me.")
